from django.shortcuts import render,HttpResponse
from django.views import View

# from django.db import models

# Create your views here.

class Login(View):

    def dispatch(self, request, *args, **kwargs):
        print("请求之前执行")
        super().dispatch(request, *args, **kwargs)
        print("请求之后执行")

    def get(self, request):
        return HttpResponse("Login.get")

    def post(self, request):
        pass


class Index(View):
    """
    分页，获取用户数据
    """

    def get(self,request):
        pass

    def post(self,request):
        pass


import os

if __name__ == '__main__':
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "auto_test.settings")
    import django
    django.setup()
    from app01 import models
    books = models.UserInfo.objects.all()
    print(books)